<script>
const arr = [1, 2, 3, 4, [1, 2, 3, [1, 2, 3, [1, 2, 3]]], 5, "string", { name: "弹铁蛋同学" }]
//1、for
for(let i=0;i<arr.length;i++){
    console.log(arr[i])
}
//2、for of
for(let value of arr){
    console.log(value)
}
//3、for in
for(let i in arr){
    console.log(arr[i])
}
//4、forEach
arr.forEach(item => {
    console.log(item)
})
//5、for of entries() 迭代器
for(let a of arr.entries()){
    console.log(a[1])
}
//6、for of keys() 迭代器
for(let i of arr.keys()){
    console.log(arr[i])
}
//7、for of values() 迭代器
for(let value of arr.values()){
    console.log(value)
}
//8、reduce
arr.reduce((pre,cur) => {
    console.log(cur)
},[])
//9、map
arr.map(value => {
    console.log(value)
})

</script>